package com.nobuyme.box.toy;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.nobuyme.box.R;
import com.nobuyme.box.util.FragmentUtils;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

import butterknife.OnClick;

public class ToyShareActivity extends BaseActivity {
    int id;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        id = getIntent().getIntExtra("goods_id",0);
        ToyShareFragment toyShareFragment = ToyShareFragment.newInstance(id);
        FragmentUtils.replaceFragment(getSupportFragmentManager(),R.id.fl_share,toyShareFragment);
        hideToolbar();

    }

    public static void start(Activity activity,int goods_id) {
        Intent intent = new Intent(activity, ToyShareActivity.class);
       intent.putExtra("goods_id",goods_id);
        activity.startActivity(intent);
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View inflate = inflater.inflate(R.layout.activity_toy_share, null);

        return inflate;
    }

    @OnClick(R.id.iv_share_back)
    public void onViewClicked() {
        finish();
    }
}
